#ifndef __PARAM_H__
#define __PARAM_H__
#include "stm32f4xx.h"
#include "rtos.h"
#define PARAM_ADDR   7*1024*1024

#define STA_AP_SSID_MAX_LEN   31
#define STA_AP_PASS_MAX_LEN   31

#define SERVER_IP_MAX_LEN     47



#pragma pack (4)
typedef struct
{
	u8 sta_ap_ssid[STA_AP_SSID_MAX_LEN];
	u8 sta_ap_pass[STA_AP_PASS_MAX_LEN];
	u8 server_ip[SERVER_IP_MAX_LEN];
	u16 server_port;
	
	u16 crc16;
}param_t;
#pragma pack ()

extern param_t param;
extern SemaphoreHandle_t  mutex_param;

#define param_set(member,value_set_p)     __param_set(OFFSET_OF(param_t,member),SIZEOF_OF(param_t,member),value_set_p)
#define param_get(member,value_out_p)     __param_get(OFFSET_OF(param_t,member),SIZEOF_OF(param_t,member),value_out_p)
void load_param(void);
void save_param(void);

#endif




















